package com.lu.demo;

import com.lu.bean.impl.UserImpl;
import com.lu.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Userdemo {
    public static void main(String[] args) {
        ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
        /*UserService userService1 = app.getBean("userService", UserService.class);
        UserService userService2 = app.getBean("userService", UserService.class);
        UserService userService3 = app.getBean("userService", UserService.class);
        UserService userService4 = app.getBean("userService", UserService.class);
        System.out.println(userService1);
        System.out.println(userService2);
        System.out.println(userService3);
        System.out.println(userService4);
        app.close();*/

       /* UserImpl user = app.getBean("user", UserImpl.class);
        user.name();*/

        UserService userService = app.getBean("userService", UserService.class);
        userService.eat();

    }
}
